package com.gang.mars.basic.classatt;

import sun.reflect.generics.scope.MethodScope;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @author gang.chen
 * @description
 * @Date 2021/7/20 13:02
 */
public class Orange01Test {

    public static Method[] methods;


    public static void main(String[] args) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException, InstantiationException {
        Class<Orange01> aClass = (Class<Orange01>) Class.forName(Orange01.class.getName());
        Orange01 orange01 = aClass.newInstance();
        methods = test01(Orange01.class);
        for (Method method : methods) {
            Object invoke = method.invoke(orange01);
            System.out.println(invoke);
        }
    }

    public static Method[] test01(Class<?> clazz){
        return clazz.getDeclaredMethods();
    }
}
